-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed Fermat and frobenius_underwood tests; made strong_lucas test private #466
Conversation
Why is miller rabin still public? I would prefer something else here.
Ping @czurnieden @sjaeckel |
Because it is useful as a stand-alone function:
< make [...] In it's reduced function (only a small table, instead of a sieve): yes.
Tempting but
They work in combination to make the BPSW test. The order does not matter much (although you need to put the
Yeah, the whole thing needs a bit of a clean-up, admitted, but cryptographic functions are quite sensible and should not be touched without a very good reason. What is your reason to move that test?
The Frobenius-Underwood test is gone for good (was only needed for The Miller-Rabin full:
BPSW:
BPSW short: BPSW "paranoid" (as it is now):
Where BPSW "paranoid" would be the algorithm for If we make a function You can fiddle with the preamble as long as the result is an odd number larger than two. The condition of non-square is not necessary for MIller-Rabin but would need an additional round which is on average more costly than the is-square test and the Lucas-Selfridge test doesn't like squares either but it is not technically needed. PS: there seems to be an interesting ansatz to proof the independence of MIller-Rabin and Lucas tests by Alec Leng but it dates March 2017 and I found no follow-up. Asking himself? Yeah, might do. |
Why do I need it when I have the mp_is_prime function which does things better? By allowing configuration of the components, expert users can switch out the test. But I think it would be best to provide an API which fits to the common usage pattern. I don't understand why Miller-Rabin is so special that it should be exposed as a single test in contrast to the other ones.
It has been changed before I think. This time we would not change the defaults, but would allow internal selection of other tests if that is desired. The default as of now is BPSW or the even the paranoid variant? By adjusting the configuration the function can be modified (as can many other parts of the library). The user has to know what they are doing in that case. But the configuration mechanism is a very internal thing since 2.0 at least, so I am not worried about that. And we should probably put another warning to the documentation regarding configuration.
Yes one has to be careful but I think it would be nice to have this prime table used by only one function. |
Obsoleted by #541 |
Removed without replacement:
mp_prime_fermat
mp_prime_frobenius_underwood
Made private:
mp_prime_strong_lucas_selfridge